package com.amumu.drama.portal.config;

import com.amumu.drama.portal.component.LoginMemberArgResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

@Configuration
public class MethodArgResolverConfig extends WebMvcConfigurerAdapter {

    private final LoginMemberArgResolver loginMemberArgResolver;

    public MethodArgResolverConfig(LoginMemberArgResolver loginMemberArgResolver) {
        this.loginMemberArgResolver = loginMemberArgResolver;
    }

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(loginMemberArgResolver);
    }
}
